import axios from 'axios';

// let base ="http://121.36.13.233:8080";
let base ="http://localhost:8080";
axios.defaults.withCredentials=true;
export const requestLogin = params => { return axios.get(`${base}/user/user/login/`+params.username+'/'+params.password, ).then(res => res.data); };

export const getOrderList = params => { return axios.get(`${base}/manage/order/list.do`, { params: params }); };

export const getCategoryList = params => { return axios.get(`${base}/category/show`, { params: params }); };

export const removeUser = params => { return axios.get(`${base}/user/remove`, { params: params }); };

export const batchRemoveUser = params => { return axios.get(`${base}/user/batchremove`, { params: params }); };

export const edCategory = params => { return axios.get(`${base}/manage/category/set_category.do`, { params: params }); };

export const edProduct = params => { return axios.get(`${base}/manage/product/save.do`, { params: params }); };

export const getProductList = params => { return axios.get(`${base}/manage/product/search.do`, { params: params }); };

export const addCategory = params => { return axios.get(`${base}/manage/category/add_category.do`, { params: params }); };